let calculatorMount = {
    input: null,
    init: function (opts) {
        this.input = $(opts.id);
        this.initEvents();
        return this;
    },
    initEvents: function () {
        let that = this;
        this.input.on('keyup', function () {
            that.render();
        })
    },
    getNum: function () {
        return this.input.val().length;
    },
    render: function () {
        let num=this.getNum(),$inputText=$('#input-text');
        if($inputText.length===0){
            $inputText=$('<span id="input-text"></span>')
        }
        $inputText.html(num);
        this.input.after($inputText);
    }
};
$(function () {
    calculatorMount.init({id:'#app'}).render();
});